package com.example.service.backup;

import com.example.service.MessageService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

public class MessageServiceImpl implements MessageService {

    private ArrayList<String> mesList = new ArrayList<>();

    @Override
    public void sendMessage(String id) {
        System.out.println("待发送短信的订单消息已纳入消息队列 id是：" + id);
        mesList.add(id);
    }

    @Override
    public String doMessage() {

        String id = mesList.remove(0);
        System.out.println("已完成短信发送 id：" + id);
        return id;
    }
}
